# -*- coding:utf-8 -*-
"""
Author：Administrator
Date:2021年03月08日
"""
from docx import Document


doc = Document("test1.docx")
list1 = [
	["姓名", "姓别", "家庭地址"],
	["唐僧", '男', "湖北省"],
	["孙悟空", '男', "北京市"],
	["猪八戒", "男", "广东省"],
	["沙和尚", "男", "湖南省"],
]
list2 = [
	["姓名", "姓别", "家庭地址"],
	["貂蝉", '女', "河北省"],
	["杨贵妃", '女', "贵州省"],
	["西施", "女", "山东省"],
]
table1 = doc.add_table(rows=5,cols=3)
for row in range(5):
	cells = table1.rows[row].cells
	for col in range(3):
		cells[col].text = str(list1[row][col])

doc.add_paragraph("="*50)
table2 = doc.add_table(rows=4,cols=3)
for row in range(4):
	cells = table2.rows[row].cells
	for col in range(3):
		cells[col].text = str(list2[row][col])

doc.save("test1.docx")